import { useReducer } from "react";
const useMyReducer = () => {
    const initState = {
        count: 0
    }
    const reducer = (state, action) => {
        console.log(action);
        if (action.type === "increase") {

            return {
                count: state.count + 1
            }
        }
        if (action.type === "decrease") {

            return {
                count: state.count - 1
            }
        }
    }
const [state, dispatch] = useReducer(reducer, initState)
return [state, dispatch];
}
export default useMyReducer;